/* SPDX-License-Identifier: GPL-2.0+
 *
 * (C) Copyright 2020
 * Anton Puiu, anton.puiu@email.com
 */

#ifndef MODE_H
#define MODE_H

#include <string.h>

#define READ_MODE 'r'
#define WRITE_MODE 'w'
#define APPEND_MODE 'a'

#define UPDATE_CHAR '+'
#define STR_TERMINATOR '\0'

typedef enum {
	READ,
	READ_UPDATE,
	WRITE,
	WRITE_UPDATE,
	APPEND,
	APPEND_UPDATE,
	UNKNOWN_MODE
} MODE;

MODE mode_get(const char *mode);

#endif
